﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Remote_server
{
    /// <summary>
    /// Delegate used when an RspClient is accepted by
    /// an RspListener
    /// </summary>
    /// <param name="sender">The RspListener</param>
    /// <param name="e">EventArgs containing the client and a timestamp</param>
    public delegate void RspClientAcceptedEventHandler(object sender, RspClientAcceptedEventArgs e);

    /// <summary>
    /// These event arguments are passed together with the
    /// RspClientAcceptedEventHandler when a client is accepted
    /// by a listener
    /// </summary>
    public class RspClientAcceptedEventArgs : EventArgs
    {
        /// <summary>
        /// The RspClient that was authenticated
        /// </summary>
        public RspClient Client { get; private set; }
        /// <summary>
        /// The time that this occured
        /// </summary>
        public DateTime Time { get; private set; }

        /// <summary>
        /// Initialize with the connected client
        /// </summary>
        /// <param name="client">The connected client</param>
        public RspClientAcceptedEventArgs(RspClient client)
        {
            Client = client;
            Time = DateTime.Now;
        }
    }
}
